#ifndef _FLTDLG_H_
#define _FLTDLG_H_

/*
typedef struct _sql_query_node
{
	unsigned long id;
	unsigned long flags;
	char *db_col;
	db_list_node *db_cond;
	char *value;
	void *user_data;
} sql_query_node;

typedef struct _sql_value_node
{
	unsigned long flags;
	char *value;
} sql_value_node;

typedef struct _sql_query_parts
{
	unsigned long flags;
	unsigned long count_names;
	unsigned long count_joins;
	unsigned long *offsets;
	unsigned long offsets_count;
	char *names;
	char *values;
	char *from;
	char *where;
	char *group;
	char *order;
	char *temp_name;
} sql_query_parts;

typedef struct _lv_column_node
{
	unsigned long id;
	unsigned long flags;
	unsigned long cx;
	char *hu_name;
	void *user_data;
} lv_column_node;


int cb_lv_by_ud(void *data1, void *data2);
int cb_lv_by_id(void *data1, void *data2);
void cb_free_lv(void *data, void *data2);
int lv_free(db_list_node **db_node, void (*cb_free_user_data)(void *));
db_list_node *lv_column_add(db_list_node **db_node, unsigned long id, unsigned long flags, unsigned long cx, char *hu_name, void *user_data);
int lv_build(db_list_node *db_node, HWND hwnd, unsigned long *order_ids, unsigned long count);
int lv_build(db_list_node *db_node, HWND hwnd);

int cb_sql_query_by_key(void *data1, void *data2);
int cb_sql_query_by_ud(void *data1, void *data2);
int cb_sql_query_by_id(void *data1, void *data2);
int sql_query_free(db_list_node **query, void (*cb_free_user_data)(void *));
db_list_node *sql_query_column_add(db_list_node **db_node, unsigned long id, unsigned long flags, char *db_col, db_list_node *db_cond, void *user_data);
db_list_node *sql_query_cond_add(db_list_node *col_node, unsigned long flags, char *value);
char *sql_query_build2(unsigned long flags, db_list_node *db_node, char *table_name, unsigned long *data_ids, unsigned long count);
char *sql_query_value(unsigned long flags, char *value);
db_list_node *sql_query_reset_conds(db_list_node *db_node);
*/


typedef struct _select_dialog_info
{
	unsigned long flags;
	char *table_name;
	db_list_node *sql_query;
	db_list_node *lv_node;
	odbc_result *db_data;
	char *title;
	odbc_row *result;
	db_list_node *db_display;
	unsigned long display_count;
	CRITICAL_SECTION cs;
} select_dialog_info;

int lv_build(db_list_node *db_node, HWND hwnd, unsigned long *order_ids, unsigned long count);
int lv_build(db_list_node *db_node, HWND hwnd);

unsigned long SelectDialog(unsigned long flags, db_list_node *query, db_list_node *lv, char *table_name, odbc_result **result, HWND hwnd, char *title);
BOOL CALLBACK DialogProc_ListFilter(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);


#endif //_FLTDLG_H_
